package com.rerun.common.quartz;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rerun.common.util.JsonDateFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 任务详细参数实体
 *
 * @author dax.
 * @version v1.0
 * @since 2017 /10/24 11:54
 */
public class QuartzJobBean implements Serializable {
    private static final long serialVersionUID = -35296405021749592L;


    /**任务名*/
    private String jobName;
    /**任务组名*/
    private String jobGroupName;
    /**任务触发器名*/
    private String triggerName;
    /**任务触发器组名*/
    private String triggerGroupName;
    /**任务描述*/
    private String description;
    /**任务状态*/
    private String  status;
    /**任务执行类*/
    private String jobClassName;
    /** 前一次运行时间 */
    @JsonSerialize(using=JsonDateFormat.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date previousTime;
    /** 下次运行时间 */
    @JsonSerialize(using=JsonDateFormat.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date nextTime;
    /** cron表达式*/
    private String cron;



    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getJobGroupName() {
        return jobGroupName;
    }

    public void setJobGroupName(String jobGroupName) {
        this.jobGroupName = jobGroupName;
    }

    public String getTriggerName() {
        return triggerName;
    }

    public void setTriggerName(String triggerName) {
        this.triggerName = triggerName;
    }

    public String getTriggerGroupName() {
        return triggerGroupName;
    }

    public void setTriggerGroupName(String triggerGroupName) {
        this.triggerGroupName = triggerGroupName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getJobClassName() {
        return jobClassName;
    }

    public void setJobClassName(String jobClassName) {
        this.jobClassName = jobClassName;
    }

    public Date getPreviousTime() {
        return previousTime;
    }

    public void setPreviousTime(Date previousTime) {
        this.previousTime = previousTime;
    }

    public Date getNextTime() {
        return nextTime;
    }

    public void setNextTime(Date nextTime) {
        this.nextTime = nextTime;
    }

    public String getCron() {
        return cron;
    }

    public void setCron(String cron) {
        this.cron = cron;
    }



    @Override
    public String toString() {
        return "{" +
                "jobName:" + jobName +
                ", jobGroupName:" + jobGroupName +
                ", triggerName:" + triggerName +
                ", triggerGroupName:" + triggerGroupName +
                ", description:" + description +
                ", status:" + status +
                ", jobClassName:" + jobClassName +
                ", previousTime:" + previousTime +
                ", nextTime:" + nextTime +
                ", cron:" + cron +
                '}';
    }
}
